package model;

import annotion.Id;
import annotion.Relation;
import annotion.Table;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Table("orders")
public class Orders implements Serializable {
    @Id
    private Integer id;
    @Relation("user_id")
    private User user;
    @Relation("goods_id")
    private Goods goods;
    @Relation("address_id")
    private Address address;
    private Date time;
    private Integer state;
    private Integer number;
    private String order_no;//订单编号
    private String trade_no;//支付宝交易号
    private int payment;//支付方式
    private BigDecimal real_price;//实际价格

    public BigDecimal getReal_price() {
        return real_price;
    }

    public void setReal_price(BigDecimal real_price) {
        this.real_price = real_price;
    }

    public String getOrder_no() {
        return order_no;
    }

    public void setOrder_no(String order_no) {
        this.order_no = order_no;
    }

    public String getTrade_no() {
        return trade_no;
    }

    public void setTrade_no(String trade_no) {
        this.trade_no = trade_no;
    }

    public int getPayment() {
        return payment;
    }

    public void setPayment(int payment) {
        this.payment = payment;
    }

    public Orders() {
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Goods getGoods() {
        return goods;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }



    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    @Override
    public String toString() {
        return "Orders{" +
                "id=" + id +
                ", user=" + user +
                ", goods=" + goods +
                ", address=" + address +
                ", time=" + time +
                ", state=" + state +
                ", number=" + number +
                ", order_no='" + order_no + '\'' +
                ", trade_no='" + trade_no + '\'' +
                ", payment=" + payment +
                ", real_price=" + real_price +
                '}';
    }
}
